package com.lam.mall.entity;

import com.lam.common.validate.group.Add;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictValid;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotNull;
import com.lam.common.components.dict.annotation.Dict;
import com.baomidou.mybatisplus.annotation.TableField;
import javax.validation.constraints.Null;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lam.common.base.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;

/**
 * 商城用户对象 mall_user
 * 
 * @author admin
 * @date 2023-04-20
 */
@DictCheck
@TableName("mall_user")
public class MallUser implements BaseEntity{

    /** 主键 */
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 用户编码 */
    @Size(max = 50, message = "用户编码长度不能超过50个字符")
    private String userCode;

    /** 用户昵称 */
    @Size(max = 100, message = "用户昵称长度不能超过100个字符")
    private String nickName;

    /** 真实姓名 */
    @Size(max = 100, message = "真实姓名长度不能超过100个字符")
    private String realname;

    /** 登录账号 */
    @NotBlank(message = "登录账号不能为空")
    @Size(max = 100, message = "登录账号长度不能超过100个字符")
    private String username;

    /** 登录密码 */
    @Size(max = 255, message = "登录密码长度不能超过255个字符")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String loginPassword;

    /** 支付密码 */
    @Size(max = 50, message = "支付密码长度不能超过50个字符")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String payPassword;

    /** md5密码盐 */
    @Size(max = 50, message = "md5密码盐长度不能超过50个字符")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String salt;

    /** 状态(1-正常,2-禁用) */
    @NotNull(message = "状态不能为空")
    @DictValid(message = "无效的状态")
    @Dict(dictCode = "user_status")
    private Integer status;

    /** 绑定手机 */
    @Size(max = 30, message = "绑定手机长度不能超过30个字符")
    private String phone;

    /** 头像图片路径 */
    @Size(max = 255, message = "头像图片路径长度不能超过255个字符")
    private String avatar;

    /** 性别(0-未知,1-男,2-女) */
    @DictValid(message = "无效的性别")
    @Dict(dictCode = "sex")
    private Integer sex;

    /** 邮箱 */
    @Size(max = 100, message = "邮箱长度不能超过100个字符")
    private String email;

    /** 生日, 例如：2009-11-27 */
    @Size(max = 10, message = "生日, 例如：2009-11-27长度不能超过10个字符")
    private String birthDate;

    /** 用户积分 */
    private Integer score;

    /** 是否新用户(1是，0否) */
    @DictValid(message = "无效的是否新用户")
    @Dict(dictCode = "yn10")
    private Integer isNew;

    /** 注册方式（1-手机号，2-邮箱，3-账号密码） */
    @DictValid(message = "无效的注册方式")
    @Dict(dictCode = "reg_type")
    private Integer regType;

    /** 注册IP */
    @Size(max = 50, message = "注册IP长度不能超过50个字符")
    private String regIp;

    /** 注册时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /** 修改时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /** 备注 */
    @Size(max = 255, message = "备注长度不能超过255个字符")
    private String remark;

    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUserCode() {
        return userCode;
    }    
    
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getNickName() {
        return nickName;
    }    
    
    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getRealname() {
        return realname;
    }    
    
    public void setUsername(String username) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }    
    
    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword;
    }

    public String getLoginPassword() {
        return loginPassword;
    }    
    
    public void setPayPassword(String payPassword) {
        this.payPassword = payPassword;
    }

    public String getPayPassword() {
        return payPassword;
    }    
    
    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getSalt() {
        return salt;
    }    
    
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }    
    
    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }    
    
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAvatar() {
        return avatar;
    }    
    
    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getSex() {
        return sex;
    }    
    
    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }    
    
    public void setBirthDate(String birthDate) {
        this.birthDate = birthDate;
    }

    public String getBirthDate() {
        return birthDate;
    }    
    
    public void setScore(Integer score) {
        this.score = score;
    }

    public Integer getScore() {
        return score;
    }    
    
    public void setIsNew(Integer isNew) {
        this.isNew = isNew;
    }

    public Integer getIsNew() {
        return isNew;
    }    
    
    public void setRegType(Integer regType) {
        this.regType = regType;
    }

    public Integer getRegType() {
        return regType;
    }    
    
    public void setRegIp(String regIp) {
        this.regIp = regIp;
    }

    public String getRegIp() {
        return regIp;
    }    
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCreateTime() {
        return createTime;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }    
    

}
